/*
 * @Author: Meow
 * @Date: 2019-11-11 11:01:39
 * @LastEditors: Meow
 * @LastEditTime: 2019-11-22 11:50:41
 * @Description:
 */
import https from "../http";
const TZD_API = process.env.NODE_ENV == "development" ? "/tzdUrl" : `${process.env.JZT_API}`;
const WSB_API = process.env.NODE_ENV == "development" ? "/wsbUrl" : `${process.env.JZT_API}`;
const JZT_API = process.env.NODE_ENV == "development" ? "/jztUrl" : `${process.env.JZT_API}`;

const processManagementApi = {
  // TZD童章德API--------------------------------------------
  // 业务流程首页：查询流程列表
  // 业务流程详情页：查询父流程下拉列表
  queryBusiProce: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcess/queryBusiProce`,
      method: "post",
      headers: {},
      params: data
    });
  },
  // 业务流程详情页：获取父节点下拉列表 参数：versionId=1000001945928827
  // 业务流程详情页：查询流程节点列表 参数：versionId=1000001945928827
  findBusiNodeByVersionId: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcessNode/findBusiNodeByVersionId`,
      method: 'post',
      headers: {},
      params: data
    })
  },
  // 业务流程首页：停用流程 参数：busiProceId=1000000894925944
  stopBusiProce: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcess/stopBusiProce`,
      method: "post",
      headers: {},
      params: data
    });
  },
  // 业务流程首页：启用流程 参数：busiProceId=1000000894925944
  startBusiProce: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcess/startBusiProce`,
      method: "post",
      headers: {},
      params: data
    });
  },
  // 业务流程版本管理页：查询版本列表 参数：busiProceId=1000000894925944
  queryBusiProceVersion: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcess/queryBusiProceVersion`,
      method: "post",
      headers: {},
      params: data
    });
  },
  // 业务流程版本管理页：启用版本 参数：versionId=1000001013078849
  restartVersion: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcess/restartVersion`,
      method: "post",
      headers: {},
      params: data
    });
  },
  // 业务流程版本管理页：停用版本 参数：versionId=1000001013078849
  delVersionByVersionId: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcess/delVersionByVersionId`,
      method: "post",
      headers: {},
      params: data
    });
  },
  // 业务流程详情页：查询流程基本信息 参数：versionId=1000001013078849
  findBusiProceById: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcess/findBusiProceById`,
      method: "post",
      headers: {},
      params: data
    });
  },
  // 业务流程详情页：查询标签列表
  queryLabelTree: function (query) {
    return https({
      url: `${WSB_API}/label/queryLabelTree`,
      method: 'get',
      headers: {
        sendKey: "queryLabelTree"
      },
      params: query
    })
  },

  // 业务流程详情页：添加流程基本信息
  addBusiProce: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcess/addBusiProce`,
      method: 'post',
      headers: {},
      data: data
    })
  },
  // 业务流程详情页：修改流程基本信息
  updateBusiProce: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcess/updateBusiProce`,
      method: 'post',
      headers: {},
      data: data
    })
  },
  // 获取业务密级下拉列表
  queryDictInfoByType: function (query) {
    return https({
      url: `${WSB_API}/dict/queryDictInfoByType`,
      method: 'get',
      headers: {},
      params: query
    })
  },

  // 添加流程节点
  addBusiProceNode: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcessNode/addBusiProceNode`,
      method: 'post',
      headers: {},
      data: data
    })
  },


  // 添加[流程节点]执行单位
  createExecDepartment: function (data) {
    return https({
      url: `${TZD_API}/BusinessExecDepartment/createExecDepartment`,
      method: 'post',
      headers: {},
      data: data
    })
  },
  // 添加[流程节点]信息化系统
  createInfoSystem: function (data) {
    return https({
      url: `${TZD_API}/BusinessInfoSystem/createInfoSystem`,
      method: 'post',
      headers: {},
      data: data
    })
  },
  // 添加[流程节点]上游节点
  createUpstreamNode: function (data) {
    return https({
      url: `${TZD_API}/BusinessUpstreamNode/createUpstreamNode`,
      method: 'post',
      headers: {},
      data: data
    })
  },
  // 添加[流程节点]输出参数
  createOutputParam: function (data) {
    return https({
      url: `${TZD_API}/BusinessOutputParam/createOutputParam`,
      method: 'post',
      headers: {},
      data: data
    })
  },
  // 添加[流程节点]业务规则
  createRule: function (data) {
    return https({
      url: `${TZD_API}/BusinessRule/createRule`,
      method: 'post',
      headers: {},
      data: data
    })
  },







  // 获取节点基本信息详情
  findNodeDetail: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcessNode/findNodeDetail`,
      method: 'post',
      headers: {},
      params: data
    })
  },
  // 获取业务流节点执行单位
  findExecDepartment: function (data) {
    return https({
      url: `${TZD_API}/BusinessExecDepartment/findExecDepartment`,
      method: 'post',
      headers: {},
      params: data
    })
  },
  // 信息化系统查询
  findInfoSystem: function (data) {
    return https({
      url: `${TZD_API}/BusinessInfoSystem/findInfoSystem`,
      method: 'post',
      headers: {},
      params: data
    })
  },
  // 上游节点查询
  findUpstreamNode: function (data) {
    return https({
      url: `${TZD_API}/BusinessUpstreamNode/findUpstreamNode`,
      method: 'post',
      headers: {},
      params: data
    })
  },
  // 输出参数查询查询
  findOutputParam: function (data) {
    return https({
      url: `${TZD_API}/BusinessOutputParam/findOutputParam`,
      method: 'post',
      headers: {},
      params: data
    })
  },
  // 业务规则查询
  findRule: function (data) {
    return https({
      url: `${TZD_API}/BusinessRule/findRule`,
      method: 'post',
      headers: {},
      params: data
    })
  },


  // 根据流程节点删除
  delNode: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcessNode/delNode`,
      method: 'post',
      headers: {},
      params: data
    })
  },
  // --添加执行单位-单位名称下拉列表
  findOrgCatalogTree: function (query) {
    return https({
      url: `${WSB_API}/catalog/findOrgCatalogTree`,
      method: 'get',
      headers: {
        sendKey: "treeData"
      },
      params: query
    })
  },

  // 删除[流程节点]执行单位
  delExecDepartment: function (data) {
    return https({
      url: `${TZD_API}/BusinessExecDepartment/delExecDepartment`,
      method: 'post',
      headers: {},
      params: data
    })
  },
  // 删除[流程节点]信息化系统
  delInfoSystem: function (data) {
    return https({
      url: `${TZD_API}/BusinessInfoSystem/delInfoSystem`,
      method: 'post',
      headers: {},
      params: data
    })
  },
  // 删除[流程节点]上游节点
  delUpstreamNode: function (data) {
    return https({
      url: `${TZD_API}/BusinessUpstreamNode/delUpstreamNode`,
      method: 'post',
      headers: {},
      params: data
    })
  },
  // 删除[流程节点]输出参数
  delOutputParam: function (data) {
    return https({
      url: `${TZD_API}/BusinessOutputParam/delOutputParam`,
      method: 'post',
      headers: {},
      params: data
    })
  },
  // 删除[流程节点]业务规则
  delRule: function (data) {
    return https({
      url: `${TZD_API}/BusinessRule/delRule`,
      method: 'post',
      headers: {},
      params: data
    })
  },

  // 修改[流程节点]执行单位
  updateExecDepartment: function (data) {
    return https({
      url: `${TZD_API}/BusinessExecDepartment/updateExecDepartment`,
      method: 'post',
      headers: {},
      data: data
    })
  },
  // 修改[流程节点]信息化系统
  updateInfoSystem: function (data) {
    return https({
      url: `${TZD_API}/BusinessInfoSystem/updateInfoSystem`,
      method: 'post',
      headers: {},
      data: data
    })
  },
  // 修改[流程节点]上游节点
  updateUpstreamNode: function (data) {
    return https({
      url: `${TZD_API}/BusinessUpstreamNode/updateUpstreamNode`,
      method: 'post',
      headers: {},
      data: data
    })
  },
  // 修改[流程节点]输出参数
  updateOutputParam: function (data) {
    return https({
      url: `${TZD_API}/BusinessOutputParam/updateOutputParam`,
      method: 'post',
      headers: {},
      data: data
    })
  },
  // 修改[流程节点]业务规则
  updateRule: function (data) {
    return https({
      url: `${TZD_API}/BusinessRule/updateRule`,
      method: 'post',
      headers: {},
      data: data
    })
  },











  // JZT姜子涛API----------------------------------------------
  // --获取系统名称下拉列表
  findAllSys: function (query) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findAllSys`,
      method: 'get',
      headers: {
        sendKey: "treeData"
      },
      params: query
    })
  },
  // --获取参数名称下拉列表
  MetaDataRegisterfindFileOrIterface: function (query) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findFileOrIterface`,
      method: 'get',
      headers: {
        sendKey: "treeData"
      },
      params: query
    })
  }


};


export default processManagementApi;
